package listx

type IList interface {
	Add(items ...interface{})
	AddConf(cond func(index int, item interface{}) bool, items ...interface{})
	Set(index int, val interface{})
	SetList(val []interface{})
	At(index int) interface{}
	Clear()
	Dispose()
	Clone() *List
	Contains(item interface{}) bool
	ContainsCond(cond func(index int, item interface{}) bool) bool
	CountCond(cond func(index int, item interface{}) bool) int
	Every(cond func(index int, item interface{}) bool) bool
	First(cond func(index int, item interface{}) bool) (val interface{}, has bool)
	Filter(cond func(index int, item interface{}) bool) *List
	ForRange(handler func(index int, item interface{}) error)
	IndexOfConf(cond func(index int, item interface{}) bool) int
	IndexOf(item interface{}) int
	Last(cond func(index int, item interface{}) bool) (val interface{}, has bool)
	Length() int
	Pop() interface{}
	Push(item interface{})
	PushList(val IList)
	Remove(item interface{})
	RemoveAt(i int)
	Replace(i int, item interface{})
	Reverse()
	Shift() interface{}
	Slice() []interface{}
	Self() *List
	Sort(compare func(a, b interface{}) int)
	Unshift(item interface{})
	Unique() *List
	UniqueByCustomKey(getKey func(item interface{}) string) *List
	Union(a IList) *List
	UnionByCustomKey(a IList, getKey func(a interface{}) string) *List

	GroupByCount(count int) (r []*List)
	GroupByCustomKey(getKey func(item interface{}) string) map[string]*List
}
